let tempDir = `test/qiniu/`;
let file = @.fs.resolvePath(__dirname, "qiniu.js");

module.exports = function(lab) {
    return {
        "获取token": function() {
            return lab.uploader.qiniu.@getTokenToUpload(tempDir + "test")
        },
        "上传文件": function() {
            return lab.uploader.qiniu.@uploadFile(file, { path: tempDir + "autoUpload-test.js" })
        },
        /*
            HD
            已经测过
            有大文件的话可以自己测一下
        */
        /*
        "上传大文件": function() {
            return lab.uploader.qiniu.@uploadFile(@.fs.resolvePath(__dirname, "log"), { path: tempDir + "autoUpload-log.log" })
        },
        */
        "上传字符串": function() {
            return lab.uploader.qiniu.@stringUpload({
                needCover: true,
                path: tempDir + "stringUpload-test.js",
                content: "stringUpload-test-" + @.format.date(new Date(), "YYYY-MM-DD hh:mm:ss")
            })
        },
        "上传buffer": function() {
            return lab.uploader.qiniu.@bufferUpload({
                needCover: true,
                path: tempDir + "bufferUpload-test.js",
                buffer: new Buffer("bufferUpload-test-" + @.format.date(new Date(), "YYYY-MM-DD hh:mm:ss"))
            })
        },
        "刷新文件": function() {
            return lab.uploader.qiniu.@refreshUrls([tempDir + "stringUpload-test.js", tempDir + "bufferUpload-test.js"], true)
        }
    }
}